<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生信息</title>
    <style>
        table{
            text-align: center;
        }
    </style>
    <!--1.引入bootstrap的css样式-->
    <link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
    <!--1.1)添加分页的样式库-->
    <link rel="stylesheet" href="plugins/angularjs/pagination.css">
    <!--2.引入jquery的js库-->
    <script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
    <!--3.引入bootstrap的js库-->
    <script src="plugins/bootstrap/js/bootstrap.min.js"></script>
    <!--4.引入angularjs的库-->
    <script src="plugins/angularjs/angular.min.js"></script>
    <!--4.1)添加分页的js库-->
    <script src="plugins/angularjs/pagination.js"></script>
    <!--4.2）引入自定义的Service-->
    <script src="js/base_pagination.js"></script>
    <script src="js/service/studentService.js"></script>
    <script src="js/service/classesService.js"></script>
    <script src="js/controller/baseController.js"></script>
    <script src="js/controller/studentController.js"></script>
</head>
<body ng-app="myApp" ng-controller="studentController" ng-init="findClasses()">
<div class="container">
    <div class="panel panel-info">
        <div class="panel-heading">
            <div class="panel-title" style="text-align: center">
                <h3>学生信息</h3>
            </div>
        </div>
        <div class="panel panel-body">
        <table class="table table-bordered table-striped">
            <tr>
                <td colspan="8" style="text-align: left;">
                    <!--条件查询-->
                    <form class="form-inline">
                        <button ng-click="addStudent" class="btn btn-success">添加</button>
                        <input type="text" class="form-control" ng-model="searchEntity.sname" placeholder="请输入学生姓名……">
                        <input type="text" class="form-control" ng-model="searchEntity.addr" placeholder="请输入学生住址……">
                        选择班级：
                        <select class="form-control" ng-model="searchEntity.cid" ng-options="c.cid as c.cname for c in classes"></select>
                        <button ng-click="searchStudent()" class="btn btn-info">查询</button>
                    </form>
                </td>
            </tr>
            <tr>
                <td>学号</td>
                <td>姓名</td>
                <td>性别</td>
                <td>年龄</td>
                <td>住址</td>
                <td>班级</td>
                <td>出生日期</td>
                <td>操作</td>
            </tr>
            <tr ng-repeat="stud in students">
                <td>{{stud.sid}}</td>
                <td>{{stud.sname}}</td>
                <td>{{stud.sex}}</td>
                <td>{{stud.age}}</td>
                <td>{{stud.addr}}</td>
                <td>{{stud.cname}}</td>
                <td>{{converDate(stud.birth)}}</td>
                <td>
                    <button class="btn btn-primary">修改</button>
                    <button class="btn btn-danger">删除</button>
                </td>
            </tr>
            <tr>
                <!--分页导航-->
                <td colspan="8" style="text-align: left;">
                    <tm-pagination conf="paginationConf"></tm-pagination>
                </td>
            </tr>
        </table>
        </div>
        <div class="panel-footer" style="text-align:center;">
            &copy;深圳泽林
        </div>
    </div>
</div>
</body>
</html>